﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zo.ExcelBox.Base
{
    /// <summary>
    /// 共用帮助类
    /// </summary>
    public class CommonHelper
    {
        /// <summary>
        /// 计算分页数量
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentException"></exception>
        public static int CalculateTotalPages(int totalCount, int pageSize)
        {
          
            int pages = (totalCount + pageSize - 1) / pageSize;
            return pages == 0 ? 1 : pages;
        }
    }
}
